<!-- Copyright (c) 2008 by 1eEurope (Switzerland) AG, Thalwil -->

<xsl:stylesheet
  version="1.0"
  exclude-result-prefixes="x d xsl msxsl cmswrt"
  xmlns:x="http://www.w3.org/2001/XMLSchema"
  xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
  xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  <xsl:template name="Default" match="*" mode="itemstyle">
    <xsl:variable name="Break" select="string('&lt;br /&gt;')" />
    <xsl:for-each select="@*">
      <xsl:text>Variable:</xsl:text>
      <xsl:value-of select="name()"/>
      <xsl:text>=</xsl:text>
      <xsl:value-of select="."/>
      <xsl:value-of disable-output-escaping="yes" select="$Break" />
    </xsl:for-each>
  </xsl:template>
  <xsl:template name="BKS_DownloadItem" match="Row[@Style='BKS_DownloadItem']" mode="itemstyle">
  	<xsl:if test="@Title != ''">
  		<xsl:variable name="Icon">
	  		<xsl:choose>
	  			<xsl:when test="@DocIcon='docx'">
	  				<xsl:text>/_layouts/images/icdocx.gif</xsl:text>
	  			</xsl:when>
	  			<xsl:otherwise>
	  				<xsl:text>/_layouts/images/icgen.gif</xsl:text>
	  			</xsl:otherwise>
	  		</xsl:choose>
  		</xsl:variable>
	    <li class="bks_linkitem">
	      <a href="/{@FileRef}" target="_blank"><img src="{$Icon}" alt="{@DocIcon}" border="0"/><xsl:text> </xsl:text><xsl:value-of select="@Title" /> (<xsl:value-of select="@DocIcon" />, <xsl:value-of select="round(number(@FileSizeDisplay) div 1000)" /> KB)<span style="display:none"> (new window)</span></a><br />
	    </li>
    </xsl:if>
  </xsl:template>
  <xsl:template name="BKS_WebLinkItem" match="Row[@Style='BKS_WebLinkItem']" mode="itemstyle">
    <li class="bks_weblinkitem">
      <a target="_blank">
        <xsl:attribute name="href">
          <xsl:value-of select="substring-before(@Link,',')" />
        </xsl:attribute>
        <xsl:if test="@TargetNewWindow">
          <xsl:attribute name="target">
            <xsl:text>_blank</xsl:text>
          </xsl:attribute>
        </xsl:if>
        <xsl:value-of select="substring-after(@Link,',')" /><span style="display:none"> (new window)</span>
      </a>
    </li>
  </xsl:template>
  <xsl:template name="BKS_DetailPage" match="Row[@Style='BKS_DetailPage']" mode="itemstyle">
    <xsl:variable name="MaxLenght" select="220" />
    <li>
      <h2>
        <a>
          <xsl:attribute name="href">
            <xsl:value-of select="@LinkUrl" />
          </xsl:attribute>
          <xsl:value-of select="@ContentHeader" />
        </a>
      </h2>
      <p>
        <xsl:value-of select="@ContentDateTime" />
      </p>
      <p>
        <xsl:choose>
          <xsl:when test="string-length(@ContentText) &gt; 120">
            <xsl:variable name="Before" select="substring(@ContentText, 0, $MaxLenght)" />
            <xsl:variable name="After" select="substring(@ContentText, $MaxLenght, string-length(@ContentText))" />
            <xsl:value-of select="$Before" />
            <xsl:value-of select="substring-before($After, ' ')" />
            <xsl:text> </xsl:text>
            <a>
              <xsl:attribute name="href">
                <xsl:value-of select="@LinkUrl" />
              </xsl:attribute>
              <xsl:text>...</xsl:text>
            </a>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="@ContentText" />
          </xsl:otherwise>
        </xsl:choose>
      </p>
    </li>
  </xsl:template>
  <xsl:template name="BKS_Impressum" match="Row[@Style='BKS_Impressum']" mode="itemstyle">
    <li>
      <a target="_blank" href="{@WebSite}"><xsl:value-of select="@Logo" disable-output-escaping="yes" /></a><br/>
      <b><xsl:value-of select="@Title" /><br /></b>
      <xsl:value-of select="@Role" /><br/>
      <xsl:value-of select="@Address" disable-output-escaping="yes"/><br></br><br></br>
      <xsl:value-of select="@About" disable-output-escaping="yes" />
      <br/><br/><br/><br/>
    </li>
  </xsl:template>
</xsl:stylesheet>
